<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p4_元素溢出替换为省略号</title>
    <style>
        div{
            width: 200px;
            background-color: #0ff;
            /*组合代码，以下三句缺一不可*/
            white-space: nowrap;/*强制不换行*/
            overflow: hidden;/*溢出文字隐藏*/
            text-overflow: ellipsis;/*将溢出文字替换为省略号*/
        }
    </style>
</head>
<body>
    <div>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda cum deleniti dicta, dolorem, est ex facere fuga mollitia natus nisi numquam pariatur tempora tempore, tenetur unde velit? Accusamus, eligendi.
    </div>
</body>
</html>